<template>
    <div>
    <el-table
            :data="ruleData"
            border
            style="width: 100%">
        <el-table-column
                fixed
                prop="id"
                label="条件编号"
                width="150">
        </el-table-column>
        <el-table-column
                prop="distributecentre"
                label="配送中心"
                width="120">
        </el-table-column>
        <el-table-column
                prop="storage"
                label="库房"
                width="120">
        </el-table-column>
        <el-table-column
                prop="weight"
                label="重量"
                width="120">
        </el-table-column>
        <el-table-column
                prop="volume"
                label="体积"
                width="300">
        </el-table-column>
        <el-table-column
                prop="number"
                label="数量"
                width="120">
        </el-table-column>
        <el-table-column
                fixed="right"
                label="操作"
                width="100">
            <template slot-scope="scope">
                <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                <el-button type="text" size="small">编辑</el-button>
            </template>
        </el-table-column>
    </el-table>
<!--        <el-pagination
                background
                layout="prev, pager, next"
                :total="1000"
                @current-change="page"
        >
        </el-pagination>-->
    </div>
</template>

<script>
    export default {
        methods: {
            handleClick(row) {
                console.log(row);
            }





        },

        data() {
            return {
                ruleData: [{
                    id: 1,
                    distributecentre: "",
                    storage: '',
                    weight: '60',
                    volume: 50,
                    number: 10
                }
                ]
            }
        },
        created(){
            const _this=this
            axios.get('http://localhost:8181/ruleList').then(function(resp){

                 _this.ruleData=resp.data
             })
        }

    }
</script>